package com.xp.tinyurl.common.utils;

import java.util.UUID;

/**
 * @Description 生成appkey
 * @Author chengguo.pei
 * @Date 2021/9/26 11:19
 */
public class AppKeyGenUtils {

    /**
     * 根据uuid生成appkey
     * @param oriKey
     * @return
     */
    public static String genKey(String oriKey){
        StringBuffer sb = new StringBuffer();
        String uuid = UUID.nameUUIDFromBytes(oriKey.getBytes()).toString();
        for(String s : uuid.split("-")){
            sb.append(s.substring(s.length() -2));
        }
        return sb.toString();
    }

}
